<?php

namespace Prototype;

include_once "ICloneable.php";
/** 原型实体类 */
class Resume implements ICloneable
{
    /** @var string 简历名称 */
    private string $name;
    /** @var string 性别 */
    private string $sex;
    /** @var int 年龄 */
    private int $age;
    private string $timeArea;
    private string $company;

    public function __construct($name)
    {
        $this->name = $name;
    }

    /**
     * 设置个人信息
     * @param string $sex
     * @param int $age
     * @return mixed|void
     */
    public function setPersonalInfo(string $sex, int $age)
    {
        $this->sex = $sex;
        $this->age = $age;
    }

    /**
     * 设置工作经历
     * @param string $timeArea
     * @param string $company
     * @return mixed|void
     */
    public function setWorkExperience(string $timeArea, string $company)
    {
        $this->timeArea = $timeArea;
        $this->company = $company;
    }

    /**
     * 显示个人信息
     * @return void
     */
    public function display()
    {
        echo $this->name . ' ' . $this->sex . ' ' . $this->age . PHP_EOL;
        echo '工作经历 ' . $this->timeArea . ' ' . $this->company . PHP_EOL;
    }

    /**
     * 克隆
     * @return Resume
     */
    public function clone(): Resume
    {
        return clone($this);
    }
}